package com.bw.mallshop.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bw.mallshop.R;
import com.bw.mallshop.entity.HomeGoodsEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;

public class HomeGoodsAdapter extends BaseQuickAdapter<HomeGoodsEntity.DataBean, BaseViewHolder> {

    public HomeGoodsAdapter() {
        super(R.layout.item_home_goods);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder,
                           HomeGoodsEntity.DataBean dataBean) {
        ImageView imageView = baseViewHolder.getView(R.id.mGoodsDetailItemIv);
        baseViewHolder.setText(R.id.mGoodsDetailItemTitleTv,dataBean.getGoods_default_sku());
        Glide.with(imageView.getContext()).load(dataBean.getGoods_default_icon())
                .centerCrop().into(imageView);
    }

}
